﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RandomKeyGenerator
{
    public class RandomNumberGenerator
    {

        public static int cont = 0;
        private static Random r;
    

        public static void ConfigureSeed(int seed)
        {
            RandomNumberGenerator.r = new Random(seed);
        }


        public static double GenerateRandomNumber()
        {
           RandomNumberGenerator.cont++;
           return RandomNumberGenerator.r.NextDouble(); 
        }


        public static int GenerateRandomNumberFromInterval(int min, int max)
        {

            if (max < min)
                throw new Exception("Max n pode ser maior do q min");
        
            RandomNumberGenerator.cont++;
            return RandomNumberGenerator.r.Next(min, max);
          

        }
    }
}
